<?php

final class UserDaoFactory {
	private static $instance = null;
	private static $daoSet = array();

	private function __construct () {
	}

	public static function getInstance () {
		if (!self::$instance) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	public function createUserDao () {
		if (isset(self::$daoSet['userDao'])) {
			return self::$daoSet['userDao'];
		}
		require_once dirname(__FILE__) . '/UserDao.php';
		self::$daoSet['userDao'] = new UserDao();
		return self::$daoSet['userDao'];
	}
}
?>